Imports System.Drawing
Imports System.Drawing.Drawing2D

Public Class PenDashCaps

    Private Sub PenDashCaps_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub PenDashCaps_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim cx As Integer = Me.Width
        Dim cy As Integer = Me.Height
        Dim pen As Pen = New Pen(Color.Black, 25)
        pen.DashStyle = DashStyle.DashDotDot
        Dim dc As DashCap
        For dc = DashCap.Flat To DashCap.Triangle
            If dc <> 1 Then
                pen.DashCap = dc
                pen.StartCap = pen.EndCap

                e.Graphics.DrawLine(pen, cx \ 8, cy \ 4, 7 * cx \ 8, cy \ 4)
                e.Graphics.TranslateTransform(0, cy \ 4)
            End If
        Next
    End Sub
End Class